home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form fTables
- BackColor = &H00C0C0C0&
- Caption = "<none>"
- ClientHeight = 3255
- ClientLeft = 510
- ClientTop = 1575
- ClientWidth = 3000
- Height = 3660
- Icon = 0
- Left = 450
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MDIChild = -1 'True
- ScaleHeight = 3235.273
- ScaleMode = 0 'User
- ScaleWidth = 3020.895
- Top = 1230
- Width = 3120
- Begin CommandButton NewTableButton
- Caption = "&New"
- Height = 375
- Left = 120
- TabIndex = 4
- Top = 120
- Width = 855
- End
- Begin CommandButton StructButton
- Caption = "&Design"
- Height = 375
- Left = 2040
- TabIndex = 2
- Top = 120
- Width = 855
- End
- Begin CommandButton OpenButton
- Caption = "&Open"
- Height = 375
- Left = 1080
- TabIndex = 1
- Top = 120
- Width = 855
- End
- Begin ListBox cTableList
- BackColor = &H00FFFFFF&
- Height = 2175
- Left = 120
- Sorted = -1 'True
- TabIndex = 0
- Tag = "OLS"
- Top = 855
- Width = 2775
- End
- Begin Label TableListLabel
- BackColor = &H00C0C0C0&
- Caption = "Tables:"
- Height = 255
- Left = 120
- TabIndex = 3
- Top = 584
- Width = 2775
- End
- Option Explicit
- Sub cTableList_DblClick ()
- gfFromSQL = False
- Call OpenButton_Click
- End Sub
- Sub cTableList_MouseDown (Button As Integer, Shift As Integer, x As Single, Y As Single)
- If cTableList.ListIndex = -1 Then Exit Sub
- If Button = 2 Then
- PopupMenu VDMDI.PUMMain, 2
- End If
- End Sub
- Sub Form_Load ()
- If gfDBOpenFlag = True Then
- caption = gstDBName & "." & gstDataBase
- End If
- 'set the height and width
- Dim x As Integer
- x = Val(GetINIString("TBLWindowHeight", "3870"))
- Height = x
- x = Val(GetINIString("TBLWindowWidth", "3135"))
- Width = x
- x = Val(GetINIString("TBLWindowTop", "0"))
- Top = x
- x = Val(GetINIString("TBLWindowLeft", "0"))
- Left = x
- End Sub
- Sub Form_Paint ()
- Outlines Me
- End Sub
- Sub Form_Resize ()
- On Error Resume Next
- If WindowState <> 1 Then
- cTableList.Height = Height - 1350
- cTableList.Width = Width - 320
- Outlines Me
- Me.Refresh
- End If
- End Sub
- Sub Form_Unload (Cancel As Integer)
- Me.WindowState = 1
- Cancel = True
- End Sub
- Sub NewTableButton_Click ()
- If gfDBOpenFlag = False Then
- MsgBox "No DataBase Open", 48
- Exit Sub
- End If
- gfAddTableFlag = True
- fTblStru.Show MODAL
- End Sub
- Sub OpenButton_Click ()
- On Error Resume Next
- Dim qd As QueryDef
- Dim iTableType As Integer
- Dim ActionQuery As String
- If Len(cTableList) = 0 Then
- MsgBox "No Table Selected", 48
- Exit Sub
- End If
- gfFromSQL = False
- SetHourglass Me
- iTableType = TableType((cTableList))
- 'check to see if the selected table is
- 'actually a querydef in an Access database
- 'and display the SQL if pref is set
- If gstDataType = MSACCESS Then
- If iTableType = DB_QUERYDEF Then
- Set qd = gCurrentDB.OpenQueryDef(cTableList)
- gstDynaString = qd.SQL
- ActionQuery = ActionQueryType((cTableList))
- If VDMDI.PrefDisplaySQL.Checked = True Then
- fSQL.cSQLStatement = qd.SQL
- End If
- End If
- End If
- 'create a new dynaset form
- ' gstDynaString = NULL_STR
- If VDMDI.cSingleRecord = True Then
- If iTableType = DB_QUERYDEF Then
- If Len(ActionQuery) = 0 Then
- MsgBar "Opening Query Dynaset", True
- Dim dsform1 As New fDynaset
- dsform1.Show
- Else
- ResetMouse Me
- If MsgBox("Run " & ActionQuery & " Query?", MSGBOX_TYPE) = YES Then
- SetHourglass Me
- MsgBar "Executing " & ActionQuery & " Query", True
- qd.Execute
- End If
- End If
- ElseIf iTableType = DB_ATTACHEDTABLE Then
- MsgBar "Opening Dynaset on Attached Table", True
- Dim dsform2 As New fDynaset
- dsform2.Show
- ElseIf iTableType = DB_ATTACHEDODBC Then
- MsgBar "Opening Dynaset on Attached ODBC Table", True
- Dim dsform3 As New fDynaset
- dsform3.Show
- ElseIf gstDataType = SQLDB Then
- MsgBar "Opening Dynaset on ODBC Table", True
- Dim dsform4 As New fDynaset
- dsform4.Show
- Else
- MsgBar "Opening Table", True
- Dim tblform As New fTableObj
- tblform.Show
- End If
- ElseIf Len(ActionQuery) > 0 Then
- ResetMouse Me
- Beep
- MsgBox "Action Query Not Allowed w/ Data Control or Grid!", 16
- ElseIf VDMDI.cDataCtl = True Then
- MsgBar "Opening Full Table Dynaset w/ Data Control", True
- Dim dsform5 As New fDataForm
- dsform5.Show
- ElseIf VDMDI.cTableView = True Then
- MsgBar "Opening Full Table Dynaset in Grid", True
- Dim dsgrid1 As New fGridFrm
- dsgrid1.Show
- Else
- MsgBar "Opening Full Table Snapshot in Grid", True
- Dim dsgrid2 As New fGridFrmSS
- dsgrid2.Show
- End If
- ResetMouse Me
- MsgBar NULL_STR, False
- End Sub
- Sub StructButton_Click ()
- On Error Resume Next
- If Len(cTableList) = 0 Then
- MsgBox "No Table Selected", 48
- Exit Sub
- End If
- gfAddTableFlag = False
- fTblStru.Show MODAL
- End Sub
- Sub TableListLabel_DblClick ()
- RefreshTables cTableList, True
- End Sub
-